'   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     C o n n e c t i o n   f r o m   T h e r e m i n o _ C N C   t o   S t e p p e r s   A / B / C 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '     S e e   t h e   f o l l o w i n g   c o m m e n t : 
 
 '     w w w . t h e r e m i n o . c o m / b l o g / r o b o t i c s - a n d - c n c / c o m m e n t - p a g e - 6 # c o m m e n t - 2 9 5 4 7 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 '     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   M a s t e r   M o d u l e   P i n s 
 
 '     1   a n d   2   =   S t e p p e r   M o t o r   A 
 
 '     3   a n d   4   =   S t e p p e r   M o t o r   B 
 
 '     5   a n d   6   =   S t e p p e r   M o t o r   C 
 
 '     7   a n d   8   =   S t e p p e r   M o t o r   Z 
 
 
 
 '     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   M a s t e r   M o d u l e   S l o t s 
 
 '     1 0 1   a n d   1 0 2   =   S t e p p e r   M o t o r   A 
 
 '     1 0 3   a n d   1 0 4   =   S t e p p e r   M o t o r   B 
 
 '     1 0 5   a n d   1 0 6   =   S t e p p e r   M o t o r   C 
 
 '     1 0 7   a n d   1 0 8   =   S t e p p e r   M o t o r   Z 
 
 
 
 V a r i a b l e   N u m e r i c   R o t A 
 
 V a r i a b l e   N u m e r i c   R o t B 
 
 V a r i a b l e   N u m e r i c   R o t C 
 
 
 
 V a r i a b l e   N u m e r i c   P o s X 
 
 V a r i a b l e   N u m e r i c   P o s Y 
 
 V a r i a b l e   N u m e r i c   P o s Z 
 
 
 
 V a r i a b l e   N u m e r i c   D i s t X 
 
 V a r i a b l e   N u m e r i c   D i s t Y 
 
 V a r i a b l e   N u m e r i c   D i s t Z 
 
 
 
 L o a d   " T h e r e m i n o _ C N C . e x e " 
 
 O p t i o n   S p e e d     9 
 
 G o s u b   L o o p 
 
 S t o p 
 
 
 
 L a b e l   L o o p 
 
 	 '   - - - - - - - - - - - - - - - - - -   X ,   Y ,   Z   f r o m   T h e r e m i n o _ C N C 
 
 	 P o s X   =   S l o t ( 1 ) 
 
 	 P o s Y   =   S l o t ( 3 ) 
 
 	 P o s Z   =   S l o t ( 5 ) 
 
 	 ' 
 
 	 '   - - - - - - - - - - - - - - - - - -   A ,   B ,   C   r o t a t i o n s   f r o m   X   a n d   Y 
 
 	 R o t A   =     P o s X   *   0 . 5 8 5 
 
 	 R o t B   =   - P o s X   *   0 . 2 9 3   +   P o s Y   *   0 . 2 9 3 
 
 	 R o t C   =   - P o s X   *   0 . 2 9 3   -   P o s Y   *   0 . 2 9 3 
 
 	 ' 
 
 	 '   - - - - - - - - - - - - - - - - - -   A ,   B ,   C ,   Z   t o   S t e p p e r   M o t o r s 
 
 	 S l o t   1 0 1   =   R o t A 
 
 	 S l o t   1 0 3   =   R o t B 
 
 	 S l o t   1 0 5   =   R o t C 
 
 	 S l o t   1 0 7   =   P o s Z 
 
 	 ' 
 
 	 '   - - - - - - - - - - - - - - - - - -   P r e p a r e   " D i s t a n c e s   t o   d e s t i n a t i o n " 
 
 	 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 	 '         W A R N I N G   - - -   T H I S   I S   W R O N G   A N D   I N C O M P L E T E 
 
 	 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 	 D i s t X   =   R o t A   /   0 . 5 8 5   -   R o t B   /   0 . 2 9 3   -   R o t C   /   0 . 2 9 3 
 
 	 D i s t Y   =   R o t A   /   0 . 5 8 5   +   R o t B   /   0 . 2 9 3   -   R o t C   /   0 . 2 9 3 
 
 	 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 	 D i s t Z   =   S l o t ( 1 0 8 ) 
 
 	 ' 
 
 	 '   - - - - - - - - - - - - - - - - - -   " D i s t .   t o   d e s t . "   t o   T h e r e m i n o   C N C 
 
 	 S l o t   2   =   D i s t X 
 
 	 S l o t   4   =   D i s t Y 
 
 	 S l o t   6   =   D i s t Z 
 
 	 ' 
 
 	 '   - - - - - - - - - - - - - - - - - -   M i n i m i z e   t h e   C P U   c h a r g e 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 G o t o   L o o p 
 
 
 
 
 
 